home *** CD-ROM | disk | FTP | other *** search
- --
- Binary -> C/C++ Header Converter v1.0 - Readme
- --
-
- Disclaimer: CheeserWare Cannot Be Held Responsible For Any Damages
- Or Side Effects This Program May Cause, Mentally Or Physically.
-
- --
-
- Bin->Header Is A Developer Tool For Converting Binary Files Into
- C/C++ Headers, This Is Useful For Linking External Files Into The
- Executable.
-
- --
-
- Installation: An Installation Wizard Was Not Used In This Project, Because
- It's Just Too Small And Simple To Need An Installer. The Installer Logo BMP
- Alone Would Be Bigger Than The Entire Application :)
-
- To Install: Unzip BinHeader10.zip To A Directory Of Your Choice. It Can
- Be Run From Any Directory. It Doesn't Create Any Files Other Than The
- Destination File You Specify.
-
- --
-
- Example:
- Replace "IDENTIFIER" With Whatever Identifier You Specified In Conversion
- "IDENTIFIER_size" Is The Length, In Bytes Of "IDENTIFIER"
-
-
- //Include The File As Any Other Include File
- #include "thehdrfile.h"
-
-
- signed long i;
- for(i=0;i<IDENTIFIER_size;i++)
- {
- unsigned char eachbyte=IDENTIFIER[i];
- /*
- This Will Loop Through Each Byte Of The Data, Setting "eachbyte"
- To The Byte Value At Offset "i". Your Handler Code Goes Here.
- For Example, To Display A Block Of Standard Text:
- cprintf("%c",eachbyte);
- */
- };
-
-
- //For Block Copying
-
- #define bytestocopy 1024
- unsigned char destblock[bytestocopy];
- memcpy(destblock,&IDENTIFIER[sourceoffset],bytestocopy);
- //This Will Copy "bytestocopy" Bytes From "sourceoffset", Into "destblock"
-
-
- //To Write The Data To A File
- int h=createfileandreturnhandle();
- write(h,IDENTIFIER,IDENTIFIER_size);
- close(h);
-
- --
-
- Note: To Use Data Linked Into Your Executable Efficiently, Write Your
- Load Functions To Be Capable Of Loading Straight Out Of Memory As Well As
- Files. Once You've Worked With It A Couple Times You'll Find You Can Load
- Any Format Straight Out Of Memory. I Have Made Non-Public Libraries Capable
- Of Loading PCX, BMP, WAV, MID, Others. This Code Is Currently Not Publicly
- Available, But Perhaps It's Existance Will Inspire You To Try It Yourself.
- If You Are A Beginner, You Can Just Write The Data To A Temporary File
- At Runtime, Then Give The Temporary File To Your LoadFile() Code. This Is
- Slow And Inefficient, But Functional.
-
- --
-
- -Cheeser [SLC, UT]
- E-mail - cheeser@aros.net : Questions, Comments, Bug Reports
- Web - www.aros.net/~cheeser : CheeserWare Home Page
-
- --
-